
#include <stdlib.h>
#include <stdio.h>
#ifndef _MATRIXPARSER_H
	#define _MATRIXPARSER_H

/*Struct that stores the Data*/
struct DATA
{
    int initialized;
    int m_order;  /*J_ORDER*/
    int row_test; /*J_ROW_TEST*/
    int max_it;   /*J_ITE_MAX*/
    double eps;   /*J_ERROR*/
    double *a;    /*MA*/
    double *b;    /*MB*/
    double *x;
    char *str;
};

/*Reads a file and initialize struct DATA*/
int initializeData(struct DATA *, FILE *);

/*Read text from a file*/
char *readText(FILE *);

/**
* Read the header: 
* J_ORDER, J_ROW_TEST, J_ERROR, J_ITE_MAX
*/
int readHeader(char *, int * morder,int * row_test,double * eps, int * max_it);

/**
* Read the matrix: 
* MA, MB
*/
int readMatrix(char *str, double *x, double *a, double *b,int m_order);

/*Printe header*/
void printHeader(struct DATA *data);

/*Print struct DATA*/
int printDataStruct(struct DATA *data);

int removeDataStruct(struct DATA *data);

#endif
